﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model IEnumerable<PerfectBuyData.Usuario>

@{
    ViewBag.Title = "Index";
}

<h2>Usuarios</h2>

<p>
    @Html.ActionLink("Agregar Usuario", "Create")
</p>
<table class="lista-usuarios">
    <tr>
        <th>Nombre
        </th>
        <th>Correo
        </th>
        <th>Rol
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.userName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.email)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.rol)
            </td>
            <td>
                @Html.ActionLink("Editar", "Edit", new { id = item.idUsuario }) |
            @Html.ActionLink("Detalles", "Details", new { id = item.idUsuario }) |
            @Html.ActionLink("Eliminar", "Delete", new { id = item.idUsuario })
            </td>
        </tr>
    }

</table>
